from sys import argv

script,filename = argv

print(f"We are going to erase {filename}")
print("hit CTRL-C (^C)")
print("hit RETURN")

input("?")#暂时没用

print("Opening the file")#若没有会自动创建
target = open(filename,'w')

print("Truncating the file")#???
target.truncate()#???

print("ask for three lines")

line1 = input("line1: ")
line2 = input("line2: ")
line3 = input("line3: ")

print("write these to file")

target.write(line1)
target.write("\n")
target.write(line2)
target.write("\n")
target.write(line3)
target.write("\n")

print("close it")
target.close()